a122b1
@@ -160,7 +160,9 @@
private Hive(HiveConf c) throws HiveException {
    */
   private void close() {
     LOG.info("Closing current thread's connection to Hive Metastore.");
-    metaStoreClient.close();
+    if (metaStoreClient != null) {
+      metaStoreClient.close();
+    }
   }
 
   /**
